use crate::error::Result;
use dev_db::recreate_db;
use std::env;
use tracing_subscriber::EnvFilter;

mod config;
mod dev_db;
mod error;

#[tokio::main]
async fn main() -> Result<()> {
    let args: Vec<String> = env::args().collect();
    let cmd = &args[1];

    tracing_subscriber::fmt()
        .without_time() // For early local development.
        .with_target(false)
        .with_env_filter(EnvFilter::from_default_env())
        .init();

    if cmd == "recreateDb" {
        recreate_db().await?;
    } else {
        print!("Nothing!")
    }
    Ok(())
}
